import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

    {
        path: '/',
        name: 'one',
        component:()=>import('../components/One')

    },{
        path: '/two',
        name: 'two',
        component:()=>import('../components/TwoChart.vue')
    },{
    path: '/three',
    name:'three',
    component:()=>import('../components/Three')
    }

]

const router = new VueRouter({
    routes
})

//放出router，外部资源可以使用

//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}



export default router
